// pages/ming/ming.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    grade: '1',
    grade1: [{ ming_name:"穿刺", img: "../../img/ming/grade1/chuanci.jpg"},
      {  ming_name: "活力", img: "../../img/ming/grade1/huoli.jpg" },
      {  ming_name: "治疗", img: "../../img/ming/grade1/zhiliao.jpg" },
      {  ming_name: "斗志", img: "../../img/ming//grade1/douzhi.jpg" },
      { ming_name: "勇气", img: "../../img/ming/grade1/yongqi.jpg" },
      { ming_name: "疾行", img: "../../img/ming/grade1/jixing.jpg" },
      { ming_name: "应激", img: "../../img/ming/grade1/yingji.jpg" },
      { ming_name: "猛攻", img: "../../img/ming/grade1/menggong.jpg" },
      { ming_name: "专注", img: "../../img/ming/grade1/zhuanzhu.jpg" },
    ],
    grade2: [{ ming_name: "破甲", img: "../../img/ming/grade2/pojia.png" },
    {  ming_name: "洞察", img: "../../img/ming/grade2/dongcha.png" },
    {  ming_name: "白刃", img: "../../img/ming/grade2/bairen.png" },
      { ming_name: "刚毅", img: "../../img/ming/grade2/gangyi.png" },
      { ming_name: "幻盾", img: "../../img/ming/grade2/huandun.png" },
      { ming_name: "坚壁", img: "../../img/ming/grade2/jianbi.png" },
      { ming_name: "践踏", img: "../../img/ming/grade2/jianbi.png" },
    ],
    grade3: 
    [{ ming_name: "贯穿", img: "../../img/ming/grade3/guanchuan.png" },
    {  ming_name: "破魔", img: "../../img/ming/grade3/pomo.png" },
    {  ming_name: "信念", img: "../../img/ming/grade3/xinnian.png" },
    { ming_name: "饮血", img: "../../img/ming/grade3/yinxue.png" },
    { ming_name: "绽放", img: "../../img/ming/grade3/guanchuan.png"},
    ],
    grade4: [{ming_name: "暴戾", img: "../../img/ming/grade4/baoli.png" },
    {  ming_name: "侵蚀", img: "../../img/ming/grade4/qinshi.png" },
    {  ming_name: "正义", img: "../../img/ming/grade4/bihu.png" },
    {  ming_name: "吞噬", img: "../../img/ming/grade4/bihu.png" },
 
    ],
    grade5: [{  ming_name: "虚空", img: "../../img/ming/grade5/mengyan.png" },
    {  ming_name: "霸者", img: "../../img/ming/grade5/bazhe.png" },
    {  ming_name: "贪婪", img: "../../img/ming/grade5/chuancheng.png" },
    {  ming_name: "繁荣", img: "../../img/ming/grade5/duocui.png" },
    {  ming_name: "圣人", img: "../../img/ming/grade5/shoulie.png" }
    ]
  },
   onLoad(){
     this.fetchData();
   },
  onShareAppMessage: function () {
    return {
      title: '王者荣耀铭文百科，快来看看吧',
      path: 'pages/ming/ming'
    }
  },

  fetchData: function () {
    if (this.data.grade == '1') {
      this.setData({ ming: this.data.grade1 })
    } else if (this.data.grade == '2') {
      this.setData({ ming: this.data.grade2 })
    }
    else if (this.data.grade == '3') {
      this.setData({ ming: this.data.grade3 })
    }
    else if (this.data.grade == '4') {
      this.setData({ ming: this.data.grade4 })
    }
    else if (this.data.grade == '5') {
      this.setData({ ming: this.data.grade5 })
    }
  },

  setGrade: function (event) {
    this.data.grade = event.detail.value.toString();
    this.setData({ grade: this.data.grade });
    this.fetchData();
  }
})